import java.util.ArrayList;
import java.util.List;


public class No11 {
	
	private static String listToCSV(List<String> list, String separator){
		StringBuilder csv = new StringBuilder();
		for (int i = 0; i < list.size(); i++) {
			csv.append(list.get(i));
			if(i != list.size() - 1){
				csv.append(separator);
			}
		}
		
		return csv.toString();
	}
	
	public static void main(String[] args) {
		List<String> stringList = new ArrayList<String>();
		stringList.add("10");
		stringList.add("20");
		stringList.add("30");
		stringList.add("40");
		
		System.out.println(listToCSV(stringList, ","));
	}
}
